package fluo.http;

import com.sun.net.httpserver.*;

import java.io.IOException;
import java.net.InetSocketAddress;

public class FluoHttpServer
{
	public static final int PORT = 12345;
	public static final int BACKLOG = 0;   // none
	public static final String URL_CONTEXT = "/";
	public FluoHttpServer()
	{
		try
		{
			final HttpServer server =
				HttpServer.create(new InetSocketAddress(PORT), BACKLOG);
			server.createContext(URL_CONTEXT, new HttpServerHandler());
			server.setExecutor(null); // allow default executor to be created
			server.start();
		}
		catch(IOException e)
		{
			e.printStackTrace();
		}
	}
}
